<template>
		<view class="chat-body">
			<!-- 时间 -->
			<view class="chat-list-time u-f-ajc" v-if="item.timetext">{{item.timetext}}</view>
			<view  :class="item.isme?'chat-list u-f isme':'chat-list u-f'" >
		
			
			<image  @tap="gouserinfo" v-if="!item.isme" class="chat-list-img "　:src="item.userimg" mode="widthFix" lazy-load></image>
			<view class="chat-list-right">
				<image @tap="gouserinfo" v-if="item.type=='img'" :src="item.img" mode="widthFix" lazy-load></image>
				<text v-if="item.type=='text'">{{item.text}}</text>
			</view @tap="gouserinfo">
				<image v-if="item.isme" class="chat-list-img "　:src="item.userimg" mode="widthFix" lazy-load></image>
			</view>
		</view>
		
	
</template>

<script>
	export default{
		props:{
			item:Object
		},
		methods:{
			//到用户主页
			gouserinfo(){
				uni.navigateTo({
					url:'../../pages/user/user'
				})
			},
		}
	}
</script>

<style scoped>
	.chat-body{
		
	}
	.chat-list-time{
		color: #A2A2A2;
		font-size: 25upx;
		padding: 30upx 0;
	}
	.chat-list{
		margin-top: 20upx;
	}
	 .chat-list-right>image{
		max-width: 300upx;
		max-height: 300upx;
	}
	.isme .chat-list-right>image{
		max-width: 300upx;
		max-height: 300upx;
	}
	.chat-list-right{
		background-color: #F4F4F4;
		padding: 20upx;
		border-radius: 20upx;
		margin-right: 120upx;
		margin-left: 20upx;
	}
	.chat-list-right:after{
		position: absolute;
		left: 90upx;
		top: 10upx;
		width: 0;
		height: 0;
		background-color:#F4F4F4;
		content: '';
		border: #F4F4F4 1upx solid;
		border-color:#F4F4F4　#F4F4F4 #F4F4F4 #F4F4F4;
	}
	.isme{
	justify-content: flex-end;
	}
	.isme .chat-list-right{
		margin-right: 120upx;
	}
	.isme .chat-list-right{
		margin-right: 20upx;
		margin-left: 120upx;
	}
	.chat-list-img{
		width: 100upx;
		height: 100upx;
		border-radius: 100%;
		flex-shrink: 0;
		margin-left: 10upx;
		
	}
</style>
